# Configuration file parser
#
# Copyright (C) 2009-2010 The Written Word, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# $Id: config.py 731 2010-07-20 19:02:49Z china $

from baseclass.configbase import *

class Config (ConfigBase):
  # expected types for variables
  _var_types = {
    'bash-path' : 'string',
    'build-dir' : 'string',
    'check-sig' : 'boolean',
    'depots' : 'array',
    'dist' : 'string',
    'dist-ver' : 'array',
    'dtd-dirs' : 'array',
    'egd-socket' : 'string',
    'gpg-keyring-path' : 'string',
    'install-base' : 'string',
    'install-path' : 'string',
    'lib-path-component' : 'string',
    'lib-search-path-components' : 'array',
    'local-depot' : 'string',
    'login' : 'string',
    'password' : 'string',
    'proxy-host' : 'string',
    'proxy-login' : 'string',
    'proxy-password' : 'string',
    'quilt' : 'boolean',
    'quilt-patches' : 'string',
    'rename-matching-install-prefix-entries' : 'int',
    'sftp-known-hosts-path' : 'string',
    'sftp-private-key-path' : 'string',
    'srcdir' : 'string',
    'systype-path' : 'string',
    'tmpbasedir' : 'string',
    'umask' : 'oct',
    'unique-install-prefix' : 'int',
    'verbose' : 'int'
  }

  # valid variables in depot section
  SECTION_DEPOT_VARS = [
    'dist-ver', 'login', 'password', 'proxy-host', 'proxy-login',
    'proxy-password'
  ]

  # valid variables in dist-opts section
  SECTION_DIST_OPTS_VARS = [
    'bash-path', 'build-dir', 'check-sig', 'depots', 'dist-ver',
    'environment', 'install-base', 'install-path', 'lib-path-component',
    'lib-search-path-components', 'local-depot', 'login', 'password',
    'rename-matching-install-prefix-entries', 'unique-install-prefix'
  ]

  # valid variables in systype section
  SECTION_SYSTYPE_VARS = SECTION_DIST_OPTS_VARS
